import { useWidgetStore } from '../store';

/*
 * @Copyright: Copyright (C) AMCAX, All rights reserved.
 * @Author: 殷建峰
 * @Date: 2025-02-07 13:37:12
 * @LastEditTime: 2025-02-07 13:40:44
 * @LastEditors: 殷建峰
 * @Description:
 */
enum WidgetTypeString {
  HINT = '当前无命令操作',
  CONSOLE = '日志控制台',
}
export class WidgetManager {
  hint(val: string = WidgetTypeString.HINT) {
    useWidgetStore.setState({
      hint: val,
    });
  }
  console(val: string | string[] = WidgetTypeString.CONSOLE) {
    useWidgetStore.setState({
      consoleStr: val,
    });
  }
  leftPanelUpdata(leftPanel: string[]) {
    useWidgetStore.setState({
      leftPanel,
    });
  }
  setSelectId(id: string) {
    useWidgetStore.setState({
      selectId: id,
    });
  }
  setModalId(id: string) {
    useWidgetStore.setState({
      modalId: id,
    });
  }
  updataHisSelection(hisSelection: string[]) {
    useWidgetStore.setState({
      hisSelection,
    });
  }
}
export const widgetManager = new WidgetManager();
